@@ -1 +1,2 @@ |
||
| 1 | 1 |
node_modules/ |
| 2 |
+.DS_Store |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 |
{
|
| 2 | 2 |
"name": "hubot-multi-adapter", |
| 3 |
- "version": "0.1.19", |
|
| 3 |
+ "version": "0.2.0", |
|
| 4 | 4 |
"description": "A Hubot adapter that can receive messages thru socket.io or telegram", |
| 5 | 5 |
"main": "src/multi-adapter", |
| 6 | 6 |
"scripts": {
|
@@ -0,0 +1,30 @@ |
||
| 1 |
+# hubot-multi-adapter |
|
| 2 |
+ |
|
| 3 |
+A hubot adapter that works with multiple services. For now it can send and receive **Telegram** and **socket.io** text messages. |
|
| 4 |
+ |
|
| 5 |
+## Install |
|
| 6 |
+ |
|
| 7 |
+Install using npm: |
|
| 8 |
+ |
|
| 9 |
+```bash |
|
| 10 |
+npm install hubot-multi-adapter --save |
|
| 11 |
+``` |
|
| 12 |
+ |
|
| 13 |
+And then start the server with |
|
| 14 |
+ |
|
| 15 |
+```bash |
|
| 16 |
+HUBOT_SOCKETIO_PORT=9090 TELEGRAM_TOKEN=xxxx bin/hubot -a multi-adapter |
|
| 17 |
+``` |
|
| 18 |
+ |
|
| 19 |
+### Telegram Setup |
|
| 20 |
+ |
|
| 21 |
+To get the ```TELEGRAM_TOKEN```, talk to *@bot_father* on *Telegram*. |
|
| 22 |
+ |
|
| 23 |
+Also set up a *webhook URL* in the *Telegram API*. First delete the old one and then set a new one. Remember that this URL has to be *HTTPS*: |
|
| 24 |
+ |
|
| 25 |
+``` |
|
| 26 |
+curl -XPOST https://api.telegram.org/botXXXX/deleteWebhook |
|
| 27 |
+curl -XPOST https://api.telegram.org/botXXXX/setWebhook?url=https://example.com/api/telegram |
|
| 28 |
+``` |
|
| 29 |
+ |
|
| 30 |
+More info on *Telegram Bots* can be found [**here**](https://core.telegram.org/bots). |